"""author: songzhiqiang
   data: 2021/11/10
   project: 2021-10-28-弹珠游戏
"""
import random

person_gift = {"a": 1, "b": 2, "c": 3, "d": 4, "e": 5, "f": 6}
person = list(person_gift.keys())
gift = list(person_gift.values())
while 1:
    if len(gift) != 2:
        random_gift = random.choice(gift)
        if person_gift[person[0]] != random_gift:
            receive_person = random_gift
            print(f"{person[0]} 收到了 {receive_person}")
            person.remove(person[0])
            gift.remove(random_gift)
    elif person_gift[person[0]] != gift[0] and person_gift[person[1]] != gift[1]:
        print(f"{person[0]} 收到了 {gift[0]}")
        print(f"{person[1]} 收到了 {gift[1]}")
        break
    else:
        print(f"{person[0]} 收到了 {gift[1]}")
        print(f"{person[1]} 收到了 {gift[0]}")
        break


